Skip to content

implement php 8.4 http_get_last_response_headers and http_clear_last_response_headers - #4

Merged
TrixNEW merged 3 commits into
TrixNEW:mainfrom
vapebw:feat/php84-http-response-headers
Sep 8, 2026
Merged

implement php 8.4 http_get_last_response_headers and http_clear_last_response_headers#4
TrixNEW merged 3 commits into
TrixNEW:mainfrom
vapebw:feat/php84-http-response-headers

Conversation

@vapebw

@vapebw vapebw commented Aug 31, 2026

Copy link
Copy Markdown

Implemented PHP 8.4 http_get_last_response_headers() and http_clear_last_response_headers().

Changes

  • src/runtime/vm.zig: Added last_http_response_headers: ?*PhpArray = null to VM struct and reset it in VM.reset().
  • src/stdlib/http.zig: Implemented http_get_last_response_headers() and http_clear_last_response_headers() in entries.
  • src/stdlib/native_params.zig: Registered 0-arg parameter signatures for named arguments.
  • src/stdlib/filesystem.zig: Added CURLOPT_HEADERFUNCTION in fetchUrl() to capture response headers into last_http_response_headers on HTTP requests, and reset state on request entry.
  • tests/php84_http_response_headers.php: Added regression tests for function existence, return types, repeated clears, and reflection metadata.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: f6278241-8d74-40f3-9364-0f8292201fa7


Comment @coderabbitai help to get the list of available commands.

@TrixNEW

TrixNEW commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR @vapebw. It looks good but you need to add actual HTTP regression tests. We should verify headers after file_get_contents() as well as redirects, HTTP error responses, failed requests, and clearing after a real request. The current tests, for the most part, verify registration/state and don't actually test the main behavior being implemented.

@vapebw

vapebw commented Sep 1, 2026

Copy link
Copy Markdown
Author

Thanks for the PR @vapebw. It looks good but you need to add actual HTTP regression tests. We should verify headers after file_get_contents() as well as redirects, HTTP error responses, failed requests, and clearing after a real request. The current tests, for the most part, verify registration/state and don't actually test the main behavior being implemented.

I think its done now, regression tests are working i will appreciate review :)

@TrixNEW

TrixNEW commented Sep 7, 2026

Copy link
Copy Markdown
Owner

@vapebw Can you fix conflicts

@vapebw

vapebw commented Sep 7, 2026

Copy link
Copy Markdown
Author

@vapebw Can you fix conflicts

yeah i forgot to fix conflicts sorry

@vapebw
vapebw force-pushed the feat/php84-http-response-headers branch from 1259cc0 to 63fe8b9 Compare September 7, 2026 23:41
@TrixNEW
TrixNEW merged commit 94280ca into TrixNEW:main Sep 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants